﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dimas.Framework.Common.Utils;
using Dimas.Framework.Entity;
using Dimas.Framework.Interface.Repostory;
using Dimas.Service.DAL.EntityFramework;

namespace Dimas.Service.DAL
{
    public class EntityFrameworkSampleRepository : IEntityFrameworkSampleRepository
    {
        public ResponseSampleService GetById(int Id)
        {
            using (var context = new Dimas_Sample())
            {
                var model = (from i in context.t_Sample
                             where i.Id == Id
                             select i).ToList();
                var result = Mapper.MapList<t_Sample, ResponseSampleService>(model).FirstOrDefault();
                return result;
            }
        }
    }
}
